(Mathematica^®) for Calculus III

Department of Mathematics
Rowan University

Abera Abay, Abdulkadir Hassen, Gary Itzkowitz, Hieu Nguyen
August 1998

TABLE OF CONTENTS

Chapter 1.	Introduction  							
			1.1	Mathematica's Conventions					2
			1.2	Calculator Operations						4
			1.3	Functions							5
			1.4	Basic Inputs							6
			1.5	Basic Calculations						7
			
		Chapter 2.	Calclulus of One Variable					
			2.1	Graphs of Functions						11
			2.2`	Limits								12
			2.2	Differentiation							14
			2.3	Integration							17
			
		Chapter 3.	Parametric Equations and Polar Graphs			
			3.1	Parametric Curves						19
			3.2	Polar Curves							23
			 
		Chapter 4.	Vector Calculus						
			4.1	Vector Algebra						26
			4.2	Vector Valued Functions					29	
			
		Chapter 5.	 Functions of Several Variables				
			5.1	Graphs of Functions of Two Variables				35
			5.2	Partial Derivatives and Gradient				42
			5.3	Multiple Integrals						53

Chapter One  
 
Introduction to Mathematica

1.1   Mathematica's Conventions

1. 1. 1   Naming

Built-in Mathematica commands, functions, constants, and other expressions begin with capital letters, and are - for the most part-  one or more full-length English words. Mathematica is case sensitive and so a common cause of error is the failure to capitalize command names. For example, Plot,  Integrate, FindRoot, ParametricPlot3D are valid function names. Sin, Exp, Det, GCD, Max are some of the standard mathematical abbreviations that are exceptions to the full-length-English-word(s) rule. User defined functions and variables can be any mixture of upper and lower case letters and numbers. However, a name cannot begin with a number. By convention, user defined functions  begin with a  lower-case letter, but this is not required. For example f, g1, myPlot, r12, sOLution, Method1, are permissible function names. 

Example 1: 	 Evaluate cos(π)

Solution:     We will use this example to show two possible errors before giving the correct answer.

cos[Pi]

This is a typical capitalization error one makes when using Mathematica.  The comment before the output  Out[1] = cos[π] indicates a possible error.

Cos[pi]

Here Mathematica did not recognize pi and hence returned the command unevaluated. The correct command to evaluate cos(π) is

Cos[Pi]

NOTE:    It is worth noting that Mathematica keeps track of the calculations it performs in a given session. The inputs are denoted by In[k] and the outputs are denoted by Out[k]. Thus, In[1] is the first input and Out[1] is the output of the first input.

1. 1. 2   Parentheses, Square Brackets and Braces

Mathematica interprets various types of brackets differently. Using an incorrect type of bracket is another common source of error.  Mathematica's bracketing conventions are:

1) Parentheses, ( ), are used only for grouping. For example (x-y)^2, 1/(a+b), (x^3-y)/(x+3y^2). It is worth noting that Mathematica understands f(2) as f times 2, and not as the value of the function f at 2.

2) Square Brackets, [ ], are used for function arguments. Thus Sin[Pi], Simplify[(x^3-y`^3)/x-y)], Sqrt[346] are proper use of square brackets. If f is a user-defined function, then f[2] is f evaluated at 2.

3) Braces or curly brackets, { }, are used  for lists, ranges, and iterators. In all cases, elements are separated by commas. Here are the typical use of braces:
{1, 4, 9, 16, 25 ,36}   the list of the square of the first six positive integers.
Plot[ f[x], {x, -5,5}]   specifies the range of values for x.
Table[m^3, {m, 1, 100}] specifies the values of the iterator m, i.e., the values of m; m goes from 1 to 100.

NOTE:    We can write comments with an input. The comments should be enclosed by (* and *). For example,  Table[ (n^2),{ n, 1, 6 } ]   (*returns a list of the square of the first six positive integers*)

Example 2: 	Below we give examples of the correct and incorrect usage of brackets.

((2^3) - 4)/(4 + 3*(9^2))

[(2^3) - 4]/[4 + 3*(9^2)]

Sqrt[343]

Sqrt (343)

1. 1. 3   Equal Signs

The following are Mathematica rules of using the equal sign symbol.
1)  A single equal sign ( = )  assigns a value to a variable. Thus q=3 means that q will be assigned the value 3. If we enter 10+q^3, Mathematica will return 37. As another example take y=x^3-x+1. Now, if we assign a value for x, say x=2, then Mathematica evaluates y using that value of x  and uses the result, 7 in our case, in any input containing y afterwards. 

2) A colon-equal sign( := ) creates a delayed statement for an expression, used in defining a function. For example f[x_]:=x^3-x+1 will reevaluate the function f for each new value of x. We will say more about defining functions in Section 1.3 below.

3) A double equal sign( = = ) is a test for the equality of two expressions. If we set x = -5, then evaluating x == -5 returns True, and x == 5 returns False. Another common usage of == is as in Solve[x^3-x+1==0,x] (See Section 1.5  below.)

1. 1. 4   Referring to Previous Results

Mathematica remembers all of the inputs and outputs in a session, and we can refer to a previous output by using the percent sign (%) notation. A single % refers to Mathematica's last output, %% refers to the next-to-last output, and so on.   %k refers to output  line numbered k. For example %45 refers to output number 45. 
NOTE: CTRL +L reproduces the last input and CTRL+SHIFT+ L reproduces the last output.

1.2   Basic Calculator Operations

Mathematica uses +, - , * , / ,  and  ^  for addition, subtraction, multiplication, division and power, respectively. Multiplication can also be performed by leaving a blank space between factors.

Mathematica can  convert  numerical values to decimal form. The command for this is N[expr] or N[expr,n].  In most cases, N[expr]  returns six digits of expr or gives expr in the form n . abcde*(10^m).  N[expr,n] attempts to give n digits  of expr. Mathematica can perform calculations to arbitrary precision and can handle numbers that are arbitrarily large or small.

Example 3: 	Here are some typical usages of N[..]

Pi

N[%]

Note that the command   N[%] gives a decimalized version of the last output. Similarily  N[%k] can be used to get the decimal equivalent of Output[k].

N[Pi, 200]

Exercise 1.1. Evaluate the following expressions:
a) 103.41+20*76	b) (((5^2) + π)/(1 + π))	 c) (1/(1 + (1/(1 + (1/(4!))))))	 d) ((2.06*(10^9))/(0.99*(10^(-8))))
e) What is the remainder of 1998 divided by 13?

1.3   Functions

We can define our own function in Mathematica. The command for defining a function such as f(x) = (((x^2) + x  +  2)/(x   +   1)) in Mathematica is f[x_]:=(( (x^2) + x  +  2)/(x   +   1)). Once we evaluate this,  Mathematica will understand f[x]  as (((x^2) + x  +  2)/(x   +   1)). Thus, evaluating f[a]  returns the value of f at a, while evaluating f[ {a, b, c, ...}]   returns the values of f at  a, b, c, ... respectively. Here is an example. But first an important 
Reminder:  Mathematica reads f(a)  as f times a.

Example 4:	(a)	Define the function   f(x) = (((x^2) + x  +  2)/(x   +   1))in Mathematica 
		(b)  	Evaluate f(10)
		(c)	Evaluate f(x), for x =-3, -2, -1, 0, 1, 2, 3.

Solution:

f[x_] := (x^2 + x + 2)/(x + 1)

Observe that the output is not displayed. To check that we have defined our function correctly, we evaluate

f[x]

Since addition is commutative, this is the given function f(x). We now proceed to solve (b) and (c).

f[10]

f[{-3, -2, -1, 0, 1, 2, 3}]

Thus f(10)=112/11, and the last output shows that f(-3)=-4, f(-2)=-4, f(-1)=ComplexInfinity, f(0)=2, f(1)=2, f(2)=8/3, and f(3)=7/2. Note that  Mathematica is warning us that it has encountered the undefined expression 1/0 and gave us ComplexInfinity for f(-1).

Sometimes we may want to deal with an expression such as (((x^2) +  x +  2)/(x  +  1)) temporarily. To evaluate such expressions at some given value(s) of x, say, x = 10  or  x =-3, -2, -1, 0, 1, 2, 3,   we do not  need to define  the expression as a function. We can use the substitution command  /.  Here is how it works.

Example 5:	Consider the expression  (((x^2) +  x +  2)/(x  +  1)). 
		(a)	Find the value of this expression when x =10.
		(b)	Find the value of this expression for x=-3, -2, -1, 0, 1, 2, 3.

Solution:

(x^2 + x + 2)/(x + 1) /. x -> 10

(((x^2) + x + 2)/(x + 1)) /. 
      x -> {-3, -2, -1, 0, 1, 2, 3}

Exercise 1.2.  Enter the following functions into Mathematica:
a) f(x) = 2  (x^3) - 6  (x^2) + x - 5		b) g(x) = (((x^2) - 1)/((x^2) + 1))		c) h(x) = |(Sqrt[ x]) - 3 | 

Exercise 1.3. Evaluate the following functions using Mathematica and evaluate each function at the given point.
a) f(x) = 1001 + (x^4) at x = 25	 	b) 1 + (Sqrt[x]) + (x^(1/3)) + (x^(1/4)) at x = π

1.4   Basic Inputs

Mathematica 3.0 allows us to enter mathematical expressions and some of the commonly used commands from  6 different palettes. If we click on the File menu and go to  Palettes we will find 7 options. The first six options conatin most of the symbols we need.  BasicInput is a palette which can be used  to enter mathematical  expressions involving exponents,  rational expressions, radicals, integrals, derivatives, summation, product, matrices, some of  the commonly used constants( π,  e, i, ∞) and some of the Greek letters.

Example 6:	Enter (∫_0^1) ((x^3)/(Sqrt[2  x - 1])) dx   in a notebook.

Solution:    One way to enter this expression into a Mathematica notebook is as follows: Go to the BasicInput palette and click on the definite integration symbol \(TraditionalForm
      \`∫\_□\%□ □ 
          d□\) . Type 0 in the lower box and using the TAB key move to the top box and type 1. Use the TAB to go to the box where the integrand should be typed. While in this box go to the palette and  click on (□/□). Go back to the pallete and click on (□^□) and type (x^3) in this box. Go to the box in the denominator and then go to the palette to click on (Sqrt[□]) and type 2x-1. Finally, using the TAB once again, go to the last box and type x.

Exercise 1.4: 	Enter the following expressions in a notebook. 

	(a)	(80^(1/3))			(b)	((1024^(1/5))/(2^(-3)))		(c)	(((Sqrt[125]))^(1/3))
	
	(d)	((Sqrt[10  (a^7) b])^(1/3))		(e)	((((((x^(-3)) (y^4))/5)))^(-3))		(f)	 
          (((((3 (m^((1/6))) (n^((1/3))))/(4 (n^(((-2)/3)))))))^2)

1.5   Basic Calculations

The BasicCalculations palette contains several options. These are Arithmetic and Numbers, Algebra, Lisits and Matrices, Trigonometric and Exponential Functions, Calculus, Other Functions, and Graphics. Each of these is preceeded by a triangle. Click on the shape to see the contents of a  palette in a category.  In this section, we will discuss the options in Algebra and Calculus triangle.

1.5.1   Algebra

Algebra is subdivided into three parts: Solving Equations, Polynomial Manipulation and Complex Numbers. 
 
 Polynomial Manipulation contains the commands Expand[ ], Factor[ ],  Together[ ], Apart[ ], Cancel[ ], Simplify[ ], FullSimplify[ ].  
 
 NOTE:  The commands Expand, Factor, Together, Apart, Cancel, Simplify, FullSimplify, TrigExpand, TrigFactor, TrigReduce, ExpToTrig, PowerExpand,  and  ComplexExpand can also be entered from  AlgebraicManipulation palette of the Palettes submenu. However, the commands in AlgebraicManipulation palette are applied after entering and highlighting the expressions to which we apply the command and click on the button of the command we want from the palette. The result of a command will replace the input we have entered. In other words, the commands of AlgebraicManipulation palette are in-place simplifications.

Solving Equations  contains different forms of the Solve commands. Solve[ lhs == rhs, var] is the command to solve  the equation lhs = rhs for the variable  var. Thus, Solve[(x^2) - 1 == 0, x] is the command to solve (x^2) - 1=0 for x. In such cases where there is only one variable in the equation, we may not need to specify the varaible. Thus, Solve[(x^2) - 1 == 0, x] and Solve[(x^2) - 1 == 0] give the same solutions. Solve[{ (Subscript[lhs, 1])== (Subscript[rhs, 1]),(Subscript[lhs, 2])== (Subscript[rhs, 2]),... },{(Subscript[x, 1]), (Subscript[x, 2]),  ... } ] solves a system of equations for the variables (Subscript[x, 1]), (Subscript[x, 2]),  ...  
Numerical approximations of solutions may be obtained by the command NSolve[ lhs==rhs,var].

Example 7: 	Expand each of the following:	
		
		(a)	 (x+1)(x-1)			(b)	 (x+y-2)(2x-3)
		
Solution:  The command we need is Expand[...].

a = Expand[(x + 1) (x - 1)]

b = Expand[(x + y - 2) (2  x - 3)]

Example 8: 	Factor each of the following: 	
		(a) 	(x^3) - 2  (x^2) - 3  x			(b)	4  (x^((2/3))) + 8  (x^((1/3)))  + 4
		
Solution:    We use the Factor[...]  command.

a=Factor[(x^3) - 2  (x^2) - 3  x	]

b = Factor[ 4  (x^((2/3))) + 8  (x^((1/3)))  + 4  ]

Example 9:      Simplify the given expressions.  
	(a)	(((x^2) + 4  x - 12)/(3  x - 6))		(b)	((((2/x) - 3))/(1 - (1/(x - 1))))		(c) ((x(1 - 2  x))^(((-3)/2))) + (((1 - 2  x))^(((-1)/2)))			
Solution:	We will first use Simplify or FullSimplify command and then apply Together.

a = Simplify[(((x^2) + 4  x - 12)/(3  x - 6))]

b = FullSimplify[(((2/x) - 3)/(1 - (1/(x - 1)))) ]

Together[%]

c=FullSimplify[ ((x(1 - 2  x))^(((-3)/2))) + (((1 - 2  x))^(((-1)/2)))]

Together[%]

Note that the last result of (c) is not in its simplest form  \(TraditionalForm
      \`\((1 + x\  - 2\ x\^2)\)/\((1 - 2  x)\)\^\(3\/2\)\).  Thus, we should keep in mind that the commands Simplify and  FullSimplify are efficient for polynomials and rational function  but may not  be efficient for expressions involving radicals , trigonometric functions, and exponentials.

Example 10 : 	Perform the indicated operations:
		(a)	\(TraditionalForm
      \`\(-\(1\/x\)\) + 2\/\(x\^2 + 1\) + 1\/\(x\^3 + x\)\)			(b)	((5/y) - (6/(2  y + 1)))÷((5/y) + 4)	

Solution:

a = Together[-(1/x) + (2/((x^2) + 1)) + (1/((x^3) + x))]

b=Simplify[ ((5/y) - (6/(2  y + 1)))÷((5/y) + 4)]

Example 11:  	Solve the folowing equations:
		a) (x^2) - x - 1 = 0      			b)   ({{2  x  +  13  y  =  4}, {3  x  - 3  y  = - 5}})		
Solution:

a = Solve[(x^2) - x - 1 == 0]

b=Solve[ {2  x  +  13  y  ==  4, 3  x  - 3  y  == - 5}]

Exercise 1.5.  Expand each of the following expressions:

a) (x + 1) (x - 1) 		b) (x + y - 2) (2  x - 3)

Exercise 1.6.  Factor each of the following expressions:

a) (x^3) - 2  (x^2) - 3  x		b) 4  (x^(2/3)) + 8  (x^(1/3)) + 3.6		c) 6 + 2  x - 3  (x^3) - (x^4)

Exercise 1.7.  Simplify the following expressions using both of the commands Simplify and FullSimplify:

a) (((x^2) + 4 x - 12)/(3 x - 6))			b) ((((2/x) - 3))/(1 - (1/(x - 1))))			c) \(TraditionalForm
      \`\((x(1 - 2  x))\)\^\(\(-3\)/2\) + \((1 - 2  x)\)\^\(\(-1\)/2\)\)

Exercise 1.8.  Perform the indicated operations:

a) -(1/x) + (2/((x^2) + 1)) + (1/((x^3) + x))		b) ((5/y) - (6/(2 y + 1)))÷((5/y) + 4)

Exercise 1.9.  Solve the following equations for x:

a) (x^2) - x + 1 = 0		b) \(TraditionalForm
      \`\(x(1 - 2  x)\)\^\(\(-3\)/2\) + \((1 - 2  x)\)\^\(\(-1\)/2\) = 0\)

Exercise 1.10. Approximate the solution of the equation tan x  +  (e^x) = 0  near  x = 0.

1.5.2   Calculus

The Calculus palette is subdivided into three parts:  Common  Operations, Differential Equations and Numerical Root Finding. Common Operations contains a palette for integration, derivative, limit, summation, product, and series. The symbols for all of these can also be entered from the BasicInput palette, which was discussed in Section 1.4 above. 	
Differential Equations contains a palette for solving differential equations symbolically as well as numerically. The last part, Numeric Root Finding, contains commands for finding numerical solutions for equations by specifying an initial approximation of a root.  FindRoot [ lhs == rhs, {x, (Subscript[x, 0])}]  finds a root of the equation lhs=rhs in the variable x with a first approximation (Subscript[x, 0]). FindRoot[ lhs == rhs, {x, (Subscript[x, 0]),  a, b}] searchs for a root between a and b.  For transcendental equations or for search of a zero of a function near a given point  FindRoot is recommended.  We give an example below.

Example 12:   Solve  the equation:  sin2x  +  cosx  = 0	  		 

Solution:  We will use Solve command first and then  FindRoot.

a = Solve[Sin[2  x] + Cos[x] == 0]

a = FindRoot[Sin[2  x] + Cos[x] == 0, {x, 0}]

Thus, Solve does not give a solution while FindRoot  does. In fact, FindRoot  yields the solution  x = -0.523599 or  x = -π /6 for  the equation  sin 2x + cos x = 0. This solution is the one closest to x = 0. Similarily we can find the solutions of this equation near other points, such as 1, 2, 3, ....  We leave this to the student as an exercise. In the next chapter, we shall learn how to draw graphs of  functions. Here is the graph of  f(x) = sin(2x) + cosx.

Plot[Sin[2  x] + Cos[x], {x, -10, 10}];

CHAPTER   TWO

CALCULUS OF ONE VARIABLE

2.1   Graphs of Functions

Plot[f,{x,a,b}] generates a plot of f as a function of x as x goes from a to  b.  Plot[ { (Subscript[f, 1]), (Subscript[f, 2]), (Subscript[f, 3]), ... }, { x, a, b } ]  plots the graphs of the functions  (Subscript[f, 1]),  (Subscript[f, 2]), (Subscript[f, 3]) ...  over the interval [a,b]. Plot  has many options most of which  we will discuss in this  chapter. In  Mathematica 3.0  Plot can be entered from the menu  File-Palette-BasicCalclulations-Graphics.

Example 1:    Draw the graph of f (x)=x+(5/x) .

Plot[x+5/x , {x,-5,5}];

Example 2:  Plot the graphs of the functions  (((x^2) + x + 2)/(x + 1))and ((sin (4 x))/4) on the same set of axes for -4 ≤ x ≤ 4.

Plot[{(x^2 + x + 2)/(x + 1), Sin[4  x]/4}, {x, -6, 5}];

Notice that the graph of ((x^2)  +  x  +  2)/(x + 1) is not visible in this output since the range from -1 to 1 along the vertical axis is too small.  We can expand this range by using the PlotRange option:

\(\(\(Plot[{\((x^2 + x + 2)\)/\((x + 1)\), Sin[4  x]/4}, {x, \(-6\), 5}, 
      PlotRange -> {\(-5\), 5}]; \)
\)\)

Exercise 2.1.  Plot the graphs of the following functions on the specified interval:
a) f(x) = (x^2) + 1 on [-5, 5]	b) g(x) = (1/(x - 2)) on [0, 4]	c) h(x) = ((sin x)/x) on [-π, π]

Exercise 2.2. Plot the graphs of f(x) = 0.01  x(x - 3) (x + 3) and g(x) = 2  x + 1  together on the same set of axes and over the interval [20, 20].  Use the PlotRange option to change the range so that their points of intersection are visible.

2.2   Limits

Limit[f, x -> a]  finds the limit of the function f  when the variable x  approaches a. The command for the left hand-side limit is Limit[f, x->a, Direction->1]  and for the right hand-side limit is Limit[f, x->a, Direction->-1]. If it encounters functions about which it has no specific information, Limit returns an unevaluated expression. Limit  returns  an interval to represent a range of possible values of the function when a limit does not exist.

Example  3: 	 Evaluate   ({{lim}, {x → 1}}) ((( (x^2)  +  x  +  2)/(x  +  1)))

Limit[(x^2+x+2)/(x+1),x->1]

Example 4:	Evaluate  ({{lim}, {x → 0}}) ((( sin(4 x))/(tan x )))

Limit[Sin[4x]/Tan[x],x->0]

Example 5:	Evaluate 	({{lim}, {x → ∞}}) (((e^x)/x)) 
(Note: To enter the Euler number e,  you can either type E or obtain it from the BasicInput palette,  where you can also find ∞  among others).

Limit[E^(x)/x,x->∞]

Example 6:	Evaluate 	({{lim}, {\(x → \(1\^+\)\)}}) ((1/(ln x)) - (1/(x - 1))) 
 Note:  The natural logarithmic function ln x is one of the built-in Mathematica  functions  and  is entered as Log[x].   The logarithmic function  (Subscript[log, a]) x  is entered  as  Log[a,x].

Limit[(1/Log[x])-(1/(x-1)),x->1,Direction->-1]

Example 7: ( An example where the limit does not exist.)   Evaluate   ({{lim}, {x -> ∞}}) ( cos x)

Limit[Cos[x],x->Infinity]

Exercise 2.3.  Compute the following limits:
a) (Underscript[(lim ), x -> 1]) (x^2) - (1/(x - 1))		b) (Underscript[(lim ), x -> -5]) (100/(x + 5))		c)(Underscript[(lim ), x -> ∞])((1 + x + (x^2))/(((x^10)-x)^(1/3)))	d) (Underscript[(lim ), x -> 0]) sin (x/x)

e) \(\(lim\ \)\+\(x -> \(0\^+\)\)\)  (((1 - ln x)/((e^((1/x))) )) )		f)   ({{lim           ((( sin  x))^(1/x))}, {\(x → 
                \(0\^+\)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)}})  	g) ({{lim             ( sec 3  x cos 5  x) }, {\(x → 
                  \(\((π\/2)\)\^-
                      \)\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \)}})

Exercise 2.4. Find the derivative of f(x) = cos x  according to the limit definition and evaluate the answer at x = π.

2.3   Differentiation

All the rules of differentiation are programmed into Mathematica. This makes it easy to differentiate complicated expressions. The notation D[ f, x ] calculates the derivative of the function f  with respect to the variablre x. We can obtain higher derivatives of order n, by using the command D[f, { x, n } ]. In Mathematica 3.0 we can get the command for derivatives from the File-Palette-BasicCalculations-Calculus-Common Operations. The symbol  for the derivative of  a functions of one variable is (∂_□) □ .

Example 8:  Find the derivative of x sin x  and the value of the derivative at x = (π/4).

Solution:     There are a number of ways to find this derivative. One way is to type in D[x*Sin[x], x]. The second method is to go to the Common Operations submenu of Calculus  and click on (∂_□) □, and in the lower box type x and use the TAB key to move to the second box and type the function, in this case x*Sin[x]. The third way is to type f=x*Sin[x] and compute D[f, x].  Yet,  another way to find the derivative  is by defining a function. This is   done by typing f[x_] :=   x*Sin[x].  Now we can just type f'[a] to find the derivative of f at a. It is very important to Clear any previous use of the letters you are  going to use to denote a function or an expression.  Here  is an illustration of each of the above methods. In all the methods  except Method 5,  we will  use the substitution command  expr /.x-> a which  replaces x in expr  by the value  a.

Method 1:

D[x*Sin[x],x]

D[x*Sin[x],x]/.x-> π/4

N[%]

Method 2: (Note: x sinx should be written between parentheses. Can you guess why?)

(∂_x)  ( x*Sin[x])

(∂_x) (  x*Sin[x])  /. x -> Pi/4

Method 3:

Clear[f]  
f = x*Sin[x]

Df= D[f,x]

Df /. x->Pi/4

Method 4:

Clear[f]
f[x_] := x*Sin[x]

D[f[x], x]

D[f[x],x] /. x -> Pi/4

Method 5:

f'[x]

f'[Pi/4]

Example 9:	Find the second derivative of      x(Sqrt[(x^2) - 1])

Solution:     We give two methods:

Method 1:    We use the command D[f, { x, 2 } ]  for the second derivative of f.

D[x*Sqrt[x^2-1],{x,2}]

Together[%]

Method 2:     We use the prime notation of the derivative by defining  a function in Mathematica :

Clear[g]g[x_]:=x(Sqrt[(x^2) - 1])	g''[x]

Example 10:  Find an equation of the tangent line to the graph given by  (x^2)((x^2) + (y^2)) = (y^2) at the point (((Sqrt[2])/2), ((Sqrt[2])/2)) .

Solution:     We need to find the slope of the tangent line. That is, find  (dy/dx) at   x = ((Sqrt[2])/2) and  y = ((Sqrt[2])/2). To this end, we rewrite the given equation as (x^2)((x^2) + y[x]^2) = y[x]^2 so that Mathematica will understand y as a function of x.   We shall call this equation eq.  Then we solve deq= D[eq,x] (this is the derivative of eq with respect to x) for y'[x] and substitute x and y[x] by ((Sqrt[2])/2). (Note: An equation in Mathematica is entered as ==.)  Here are the steps outlined above.

Clear[eq,  deq, x, y]

eq =(x^2(x^2+y[x]^2)==y[x]^2)

deq=D[eq,x]

soln = Solve[deq,y'[x]]

m=  soln /. {x->Sqrt[2]/2, y[x]->Sqrt[2]/2}

The output   {{y'[(1/(Sqrt[2]))]->3}} means that the slope is 3.(Can you see why?) Finally  we write the equation of the tangent line as:

Clear[x, y]

y=3(x-Sqrt[2]/2)+Sqrt[2]/2

Together[%]

Thus, the  equation of the tangent line is y = 3 x - (Sqrt[2]).

Exercise 2.5. Compute the derivatives of the following functions:
a) f(x) =  3  (x^2) + 1	b) g(x) = (1/(x^3))		c) h(x) = ((sin x)/(cos x))  d) y = ln(cos((e^x)))    e)  y = (e^x) arcsec x

Exercise 2.6. Evaluate the derivatives of the following functions at the specified values of x:
a) f(x) = (x - 1) (x + 1) at x = 1		b)  g(x) = (((Sqrt[x]) + 1)/((Sqrt[x]) - 1)) at x = 9

Exercise 2.7. Compute the second derivatives of the functions given in Exercise 2.5.

Exercise 2.8. Find an equation of the line tangent to the graph of x + (y^2) = 0 at the point P(9, -3).

Exercise 2.9. Find all relative extrema of the function: a)  f(x) = (x^4) - 7  (x^2) + 10 and b) f(x) = ((2  (x^2) - 3  x + 5)/((x^2) + 1)).

Exercise 2.10.  Find  all relative extrema of f(x) =    (Sqrt[(x^2) + 1])  - 1/2 x. Also, find the absolute minimum and absolute maximum values of f(x) on [0,2].

Exercise 2.11. Use implicit differentiation to find ((d y)/(d x)) if (x^2) y + 3  x (y^2) - x = 3. Also find the equation of the tangent line to the graph of the equation at the point (1, 1).

Exercise 2.12. Let f(x) = (e^(sin x)) for \(TraditionalForm
      \`\(-2\) π ≤ x ≤ 2  π\) 
	(a)	Define f in Mathematica 
	(b)	Find the solutions of f ' (x) = 0.  (Hint: Use FindRoot )
	(c)	Identify the relative extrema of f. 
	(d)	Find the inflection points of f.
	(e)	Verify your answers in (b), (c), and (d) by drawing the graph of f.

2.3   Integration

Integrate[ f,  x] gives the indefinite integral of f .  Integrate[f, {x, a,b}] gives the definite integral of f over the interval  [a , b]. Integrate can evaluate integrals of rational functions. It can also evaluate integrals that involve exponential, logarithmic, trigonometric and inverse trigonometric functions, so long as the result comes out in terms of the same set of functions.  Integrate[ f,  x]  and Integrate[f, {x, a, b}] can be entered from ( what should by now be)  the familiar menu File-Palette-BasicCalculations-Calculus-Common Operations.  We can get a numerical result by applying N to a definite integral. That is, NIntegrate[f, {x, a, b}]  gives a numerical approximation to the definite integral  \(TraditionalForm
      \`∫\_a\%b\ \(f(x)\)\ \ \ dx\).

Example 11:  Evaluate   ∫((x((x^2) + 1))^2) dx

Solution:  We give two methods. In the first method, the input will be entered without using a palette. In the second method we will use a palette for the input.

Method 1:

Integrate[x(x^2+1)^2,x]

Method 2:

∫x ((((x^2) + 1))^2) \[DifferentialD]x

Question: If you use the  substitution method the answer you get is   (1/6) (((1 + (x^2)))^3) + C.  How do we reconcile these differences?

Example 12:   Evaluate   ∫(((x^5) + (x^2) +  x  +  2)/((((x^2) + 1))^2)) dx

Solution:

∫(((x^5) + (x^2) + x + 2 )/((((x^2) + 1))^2)) 
        \[DifferentialD]x

Note:    All functions in an output appear in Mathematica's notation. To convert a function in an output to a more familiar form use the command TraditionalForm. For the above example the "traditional" form is obtained as follows. (Note that log x is the same as ln x.)

∫(((x^5) + (x^2) + x + 2)/((((x^2) + 1))^2)) 
          \[DifferentialD]x // TraditionalForm

Example 13:   Approximate  (∫_0^1) tan (x^2) dx

Solution:     The first thing we want to do is let Mathematica  evaluate  the integral.  If Mathematica returns  an unevaluated integral , we use either N[%] ( a command for numerical  approximation of  the  previous output)  or   NIntegrate[f, {x, a, b}] .

(∫_0^1) Tan[(x^2)] \[DifferentialD]x

N[%]

The above two steps can be combined as follows:

NIntegrate[Tan[x^2], {x, 0, 1}]

Exercise 2.13. Integrate each of the following and check your work by differentiating the answer.

a) ∫((x^2) + 2) dx		b) ∫cos 3  x dx		c)    ∫(x/((x^2) + 1)) dx	d) ∫(((e^x) + 
                    (e^(-x)))/((e^x) - 
                    (e^(-x)))) dx

Exercise 2.14.  Evaluate each of the following integrals.
a) \(TraditionalForm
      \`∫\_0\%1\(\@\( 1 - x\^2\)\) dx\)		b) \(TraditionalForm
      \`∫\_\(-π\)\%π\( sin\^\(\ 2\)\) x 
          dx\)   	c) \(TraditionalForm
      \`∫\_2\%∞\( 1\/\@\(x(x - 1)\)\%3\) 
          dx\)

Exercise 2.15.  Approximate the area under the curve y = (Sqrt[1 - (x^2)]) and above the interval [0, 1].  (How does this answer compare with the answer in part c, Exercise 2.14 a)?)

Exercise 2.16. Compute the arc length of  the curve:
a)  y = (Sqrt[1 - (x^2)]) along the interval [0, 1]. 	b)  y = 1/6 (x^3) + 1/(2x) on [1,3].

Exercise 2.17. a) Compute the area of the region enclosed by the graphs of f(x) = (x^3) and g(x) = x.
b) Sketch the region that is bounded by the graphs of f(x) = (3^x) and g(x) = 2x+1 and find the area of the region.

CHAPTER   THREE

PARAMETRIC EQUATIONS AND POLAR GRAPHS

3.1   PARAMETRIC CURVES

Example 1:  Sketch the curve described by the parametric equation 
      x  = cos t ;  and  y = sin t,    
          0  ≼  t  ≼  
            2  πSolution : .

ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 2  π}];

Recall that the above parametric equations represent the unit circle. However, Mathematica  produced a  graph that visually looks like an ellipse due to the different settings of the x and y-axes. An important option to fix this is to use the option AspectRatio. The default value of aspect ratio, which is the ratio of  the height to the width of a plot, is 1/GoldenRatio and its value is

N[1/GoldenRatio]

This value was chosen because it produces plots that are pleasing to the eye. However, to get a plot that accurately represents the graph of the given equations we need to set aspect ratio to automatic. We do this as follows.

\(\(ParametricPlot[{Cos[t], Sin[t]}, {t, 0, 2  π}, 
	
      AspectRatio -> Automatic]; \)\)

Example 2:   Sketch the curve described by the parametric equation 

      x  = (t^2)  -  4;  and  y = (t/2)  ,  
          -2  ≼  t  ≼  3Solution : .

ParametricPlot[{t^2 - 4, t/2}, {t, -2, 3}];

Example 3:    Sketch the curve (prolate cycloid)   described by the parametric equations

	           x =2θ - 4 sinθ   and  y= 2 - 4 cosθ.
Solution:

\(\(ParametricPlot[{2  θ - 4  Sin[θ], 
        2 - 4  Cos[θ]}, {θ, \(-4\) Pi, 4  Pi}, 

      PlotLabel -> "prolate cycloid"]; \)\)

Note that in the above input we have used the the command PlotLabel. In general, the command PlotLabel ->"text" prints the title text for the given plot.

Example 4:    Folium of Descartes      Given the parametric equations
	           x  = ((4  t)/(1 + (t^3)))  and    y  = 
              ((4  (t^2))/(1 + (t^3))), perform each of the \(following . 
		
a . \ \ \ Sketch\) the curve described by the parametric \(equations . 	
b . \ \ Find\) the points of horizontal tangency to the curve.		

Solution:

\(\(ParametricPlot[{\(4  t\)\/\(1 + t\^3\), \(4  t\^2\)\/\(1 + t\^3\)}, {
        t, 0, 20}, 
	AspectRatio -> Automatic, 
      PlotLabel -> "Folium of Descartes"]; \)\)

b) In order to find the points of horizontal tangency, we find the points where the slope of the tangent line is zero. Hence, we evaluate

Solve[D[((4  (t^2))/(1 + (t^3))), t] == 0, t]

Thus, there are two points, corresponding to t = 0 and t = (2^((1/3))), at which the tangent lines are horizontal.

Example 5:  Find the arc length of the curve x = (e^(-t)) cost,  y =(e^(-t)) sint;    0 ≼ t ≼ (π/2).
   Solution:

(∫_0
        ^(π/2
          ))√(
            (D[E^(-t) Cos[t], t])^2  + 
              (D[E^(-t) Sin[t], t])^2) \[DifferentialD]t

N[%]

Exercise 3.1. Sketch the curve represented by the parametric equations.
a) x=(t^3) , y = (t^2)/2	b) x=2(θ-sin θ),  y= 1-cos θ	c) x=3(cos^3) θ, y=3(sin^(3 ))θ

Exercise 3.2. Find all points of horizontal and vertical tangency to the curve
x= cos θ + θ sin θ,  y= sin θ - θ cos θ,  0 ⪯ θ ≼2π.

Exercise 3.3.Consider the parametric equations given by x= 3 cos (t/3) - cos t and y = 3 sin (t/3) - sin t.
a) Graph the curve represented by the parametric equations.
b) Find the slope of the tangent line at the point where t = π/4.
c) Find the length of the arc from t=0 to t = 3π/2.

3.2   POLAR   CURVES

In order to graph polar equations in Mathematica, we must load the package for polar plotting, We do this  prior to plotting and by typing:

Needs["Graphics`Graphics`"]

Example 6:   Sketch the graph of r = 3 - 4 cosθ.
Solution:

\(\(PolarPlot[3 - 4  Cos[θ], {θ, \(-4\) Pi, 4  Pi}, 
	
      AspectRatio -> Automatic]; \)\)

Example 7:    Sketch the graph of the six - leaf rose r = 2 Cos(((3  θ)/2)).

Solution :

\(\(PolarPlot[2  Cos[3  θ/2], {θ, \(-4\) Pi, 4  Pi}, 
	
      PlotLabel -> "A Six-leaved Rose", AspectRatio -> Automatic]; \)\)

Example 8:    Find the area of the region that is inside the circle r = 3 sinθ and outside the convex limacon r = 2- sinθ.

Solution:  First, we plot the two polar curves on the same axes.

\(\(PolarPlot[{3  Sin[θ], 2 - Sin[θ]}, {θ, 0, 
        2  π}, 
	AspectRatio -> Automatic]; \)\)

Next, we find the values of θ that correspond to the two points of intersection of the above curves.

Solve[3  Sin[θ] == 2 - Sin[θ], θ]

Note that Mathematica gives only the solution   θ = (π/6)   which lies in the first quadrant since inverse functions are being used. We can see from the above graph that the other point of intersection must be at θ = ((5  π)/6). Thus, the area enclosed is given by (using symmetry)

\(Integrate[\((3  Sin[θ])\)^2, {θ, Pi/6, Pi/2}]\  - 

      Integrate[\((2 - Sin[θ])\)^2, {θ, Pi/6, Pi/2}]\)

N[%]

Exercise 3.4. Graph the given polar equation and find an interval for θ over which the graph is traced only once.
a) r = 3 -4 cos θ    b) r = 2 + sin θ   c) r= 3cos(3θ/2)  d) r= 5 sin 2θ

Exercise 3.5. Consider the rose curve r = cos ( 2θ) for -2π ≼  θ ⪯ 2π.
a) Graph the curve.
b) Find the area of one petal of the curve.

Exercise 3.6. Generate the butterfly curve r = (e^(cos θ)) - 2 cos (4θ) + (sin^5) (θ/12).

Exercise 3.7.  Graph and find the area of each of the following regions.
a) The common interior of r=3- 2 sin θ and r=-3+2 sin θ
b) Inside r=2 (1+cos θ) and outside r=2 cos θ
c) Inner loop of r=3+4 sin θ

Exercise 3.8.  Find the length of the given curve on the specified interval.
a) r=1+ sin θ , 0 ≼ θ≼2π.	b) r=6 (1+ cos θ),  0 ≼ θ≼2π.

Exercise 3.9. Consider the polar equations r = 4 sin θ and r = 2 ( 2 - (sin^2) θ).
a) Graph the polar equations on the same axes.
b) Find the points of intersection of the curves.
c) Find the circumference of each curve.

CHAPTER   FOUR 

VECTOR CALCULUS

4.1   VECTOR  ALGEBRA

Vectors are typed in braces with commas between components. For example if a is the vector   
a= i+3j -5k we type

a={1,3,-5}

The jth  components of a is denoted by a[[j]]. Vector addition, subtraction and scalar multiplications are performed  in a similar way as with numbers.The dot product of vectors a and b is obtained by  a.b  and the length of a is obtained by Sqrt[a.a]. 

Example  1:  Let  a= i+3j -5k and  b= -i+2j +3k.  

Find 3a-2b, a.b,   ||b||,   ||a||,   and the third component of 5a+4b.

 Solution: First we will enter the components of a and b as lists. Then we we enter the solutions for  all the problems  in one cell: (Note: It is possible to enter more than one input under the same cell but  on different lines.  To go to a new line press the  [RETURN] key. When Mathematica computes such   inputs the outputs will appear in rows with consecutive output numbers.)

a={1,3,-5}
b={-1,2,3}

3a-2b a . b Sqrt[a.a] Sqrt[b . b]	(5a+4b)[[3]]

Example 2:  Show that the dot product of vectors  is commutative and that it is distributive  over addtion, that is , a.b= b.a  and a.(b+c)=a.b+a.c for any  vectors a ,b and c. 

Solution:  We will show commutativity of dot product for vectors in space.

a={a1,a2,a3}
b={b1,b2,b3}
c={c1,c2,c3}
a.b-b.a
a.(b+c)-(a.b+a.c) (*if this is equal to 0, this proves the
 distributive property*)

It is not clear why the last output is zero. We check this by entering:

Simplify[%]

Example 3:  Let  u= i+3j + 2k  v= 2i+3 j  and w = -2i+3j +4k. Find  u × v,  i×w and the saclar triple product of  u, v, and w (that is (u × v).w)

Solution: In order to calculate the cross product of two vectors we need a package, called  Calculus`VectorAnalysis`.  It is recommended that you  load this package before starting your work.  The command to load  this package is  Needs["Calculus`VectorAnalysis`"].  To compute the cross product u × v of  u  and  v we type CrossProduct[u,v].  In Mathematica 3.0, there is a   palette that contains the command for cross product. It is in File-Palettes-Lists and Matrices-Matrix  Operations and is denoted by Cross[□ ,□]. First, we  load the package:

Needs["Calculus`VectorAnalysis`"]

u={1,3,2}
v={-2,3,0}
w={-2,3,4}
i={1,0,0}

prod= CrossProduct[u,v]
CrossProduct[i,w]
prod.w

Example 4: Consider the parallelepiped  with sides a=i+k, b=2i+j+3k  and c=i+j-2k.  

a)   Find the volume.	b)  Find the area of the face determined by  b and  c.

Solution:

a = {1, 0, 1}b = {2, 1, 3}c = {1, 1, -2}volume = Abs[a . Cross[b, c]]area = (((Sqrt[Cross[b, c] . Cross[b, c]]) )/2)

Exercise 4.1. Let u= 2i - j + 2k  and v= 5i + 4j - k.
a) Determine each of the following. i) 6u-4v	ii) ||u+v|| iii) u.v
b) Find u.v and u x v.
c) Find a unit vector that is orthogonal to both u and v.
c) Find the area of the triangle determined by u and v.

Exercise 4.2. Find the volume of the parallelepiped that is detremined by the vectors  u=i +j  and v=j + k and w = i +k .

Exercise 4.3.  Let u = (Subscript[u, 1 ])i  + (Subscript[u, 2]) j  + (Subscript[u, 3]) k,  v = (Subscript[v, 1 ])i  + (Subscript[v, 2]) j  + (Subscript[v, 3]) k  and  w = (Subscript[w, 1 ])i  + (Subscript[w, 2]) j  + (Subscript[w, 3]) k  be vectors in space. Prove that:
a)  u x ( v + w ) =  ( u x v ) + ( u x  w)	b)   u . ( v x w ) = v . ( w x u )

4.2   VECTOR VALUED FUNCTIONS

The derivative of a vector valued function  r(t) ={ x(t) , y(t) , z(t) } of a single variable t can be obtained  by entering  D[r,t].  Another way is to type MapThread[ D,{r, {t, t, t}}]. MapThread applies the operator   D  (i.e., differentiation) to each of the three components of r with respect to the corresponding parameter  in { t, t, t }, so that we get  (dx/dt),  (dy/dt),  and  (dz/dt).
 
Example 5:  Find the first and second derivative of  r(t)=a cost i +asin t j+ bt k.

Solution:  We will give two different methods. First, we want to make an observation. Once you  use letters like a ,b, x, y, etc,  to represent a certain quantity, Mathematica will keep using those values for  every input containing those letters. Thus,  before using the same letter for another representation we should tell Mathematica to clear the prevoius usage of the letters. The  command for this is (naturally)  Clear[....].  For both methods we define  r in Mathematica.

Method 1:

Clear[a, b]

r[t_] = {a Cos[t], a Sin[t],  b t}

r'[t]r''[t]

Method 2:

r1 = MapThread[D, {r[t], {t, t, t}}]r2  = MapThread[D, {r1, {t, t, t}}]

Example 6:  Represent the hyperbola 4  (x^2) - 9  (y^2) = 36 ,   
      x    ⪰   3,    in parametric form and find the equation of  the tangent line at (3, 0).

Solution: One way of representing the curve in parametric form is by using hyperbolic functions and letting 
                  x= 3 cosh t,  and  y= 2 sinh t.  
  To find the equation of the tangent line we proceed as follows:

Clear[r, t]

r[t_] := {3  Cosh[t], 2  Sinh[t]}

We solve r(t) = (3,0)  to find the value of t that corresponds to the point (3,0).  Once we find this value, say (Subscript[t, 0])  ,  
      we use the formula q (w) = r ((Subscript[t, 0])) +  
      w r' ((Subscript[t, 0]))   for the tangent line .

Solve[r[t] == {3, 0}, t]

\(
Clear[w]\)r[0]r'[0]q = r[0] + w r'[0]

Thus, a parametric equation of the tangent line is x=3, and y=2w.  The following is the graph of the  curve and the tangent line at (3,0).

\(\(\ \(ParametricPlot\ [
      \ \ {{3  Cosh[t], 2  Sinh\ [t]}\ , \ 
\ {3, 2  t}\ }, {t, \(-4\), 4}, 
      PlotStyle -> {{\ RGBColor[0.500008, \ 0.500008, \ 0]}, 
          \ {RGBColor[0, \ 0, \ 0.500008]}}, 
AspectRatio -> Automatic]; 
    \)\)\)

Example 7: Consider the curve given by   r(t)=a cost i +a sint j+ ct k.

a) Find the length of the curve from (a,0,0) to (a,0,2πc).
b) Find the arc length parametrization of the curve.
c) Find its curvature.

Solution: We begin by defining r(t) in Mathematica.

Clear[a, c]

r[t_] := {a Cos[t], a Sin[t], c t}

a) Note that when we move from (a,0,0) to (a,0,2πc), t goes from t=0 to t=2π. Thus the length of the curve  between these two points is

l = 
      (∫_0^(2  π ))(Sqrt[r'[t] . r'[t]]) 
          \[DifferentialD]t

b) The arc length parameter s is given by:

Clear[t, u]\(	s\  = 
      ∫\_0\%t\(\@\(\( r'\)[u] . \(r'\)[u]\)\) 
          \[DifferentialD]u\)

Solving for t we see that t =(s/(Sqrt[(a^2) + (c^2)])).Thus the arc length parametrization of the curve is  
r(s)  =  a  cos((s/(Sqrt[(a^2) + (c^2)])))  i +a  sin((s/(Sqrt[(a^2) + (c^2)])))  j+ (cs/(Sqrt[(a^2) + (c^2)])) k.

c)  We  first use the arc length parametrization of the curve to compute its curvature.

Clear[a, c, s]

r[s_] := {a Cos[(s/(Sqrt[(a^2) + (c^2)]))], a Sin[(s/(Sqrt[(a^2) + (c^2)]))], 
        ((c s)/(Sqrt[(a^2) + (c^2)]))}

T[s_] := ((r'[s] )/(Sqrt[r'[s] . r'[s]]))

Thus, the curvature is given by:

κ  = (Sqrt[T'[s] . T'[s]])

Simplify[%]

Method  2:  A  formula for computing  the curvature of a curve  that is not parametrized by  arc length  is  given by: 

 κ (t)=((‖  r'(t)  x  r''(t) ‖)/(‖  r' (t) 
                          (‖^3))). We evaluate this below .

r[t_] := {a Cos[t], a Sin[t], c t}\(k\  = 
      \(1\/\((\(r'\)[t] . \(r'\)[t])\)\^\(3\/2\)\) 
        \((√\((
              CrossProduct[\(r'\)[t], \(\(r'\)'\)[t]] . 
                CrossProduct[\(r'\)[t], \(\(r'\)'\)[t]])\))\)
\)

Simplify[%]

From this,  it can easily be shown that κ =   (( a)/((a^2) + (((c^2))^(  ))))

Example 8:  The curve that is represented by the vector equation r(t)  = a(1+cos(t))  i + a sin(t) j + 2a sin(t/2) k is known as Vidiani's curve.   Consider the curve for a=1.

a) Plot the curve.

b) Compute the length of the curve from  t=0 to t=π.

c)  Calculate the curvature of the curve and compute the curvature at t=0.

Solution: To plot a  curve in three dimensions, we use the command ParametricPlot3D.  The syntax for this is ParametricPlot3D[{x,y,z},{t, tmin,tmax}].

ParametricPlot3D[{1 + Cos[t], Sin[t], 2  Sin[t/2]}, {t, 0, 4  Pi}];

r[t_] := {1 +  Cos[t], Sin[t], 2  Sin[ t/2]}\(l\  = 
      ∫\_0\%π\(\@\(\( r'\)[t] . \(r'\)[t]\)\) 
          \[DifferentialD]t\ 				
\)

N[%]

\(\(
\(κ\  = 
      \(1\/\((\(r'\)[t] . \(r'\)[t])\)\^\(3\/2\)\) 
        \((√\((
              CrossProduct[\(r'\)[t], \(\(r'\)'\)[t]] . 
                CrossProduct[\(r'\)[t], \(\(r'\)'\)[t]])\))\); \)
\)\)

Simplify[%]

Thus, the curvature at t=0 is given by

% /. t -> 0

Exercise 4.4. Graph the space curve that is represented by the vector-valued function.
a) r(t) = 1/2 t i + (Sqrt[t]) j + 1/4 (t^3) k  b) r(t) = t i + ln t j + 1/2 (t^2) k

Exercise 4.5. Sketch  and find the length of the curve: 
r(t) = (sin t - t cos t) i +(cos t + t sint) j + (t^2) k.

Exercise 4.6. Find the curvature of the curve r(t) =  t i + (t^2) j + 1/2 (t^2) k.

Exercise 4.7. Plot the following pairs of intersecting lines in space and find the point of intersection.
(Subscript[L, 1]):  x = 2t + 3,  y = 5t - 2,  z = -t + 1; 	 (Subscript[L, 2])  :   x = -2t + 7, y = t + 8, z = 2t - 1.

CHAPTER FIVE

FUNCTIONS OF SEVERAL VARIABLES

5.1   GRAPHS OF FUNCTIONS OF TWO VARIABLES

The following command loads all graphics packges of Mathematica.

Needs["Graphics`Master`"]

5.1.1   Plot3D

Plot3D is the  three-dimensional analog of the Plot command. Given an expression in two variables and the domains for those two variables, Plot3D produces a surface plot. Plot3D has many options. We will discuss some of these options below. We begin with the simplest way of plotting a graph of a function of two variables.
 
Example 1:  Plot f(x,y) = sin(x-cosy).

Plot3D[ Sin[ x-Cos[y] ],{x,-3,3},{y,-3,3} ];

The first option we consider is BoxRatios. BoxRatios is an option in Plot3D used to specify the ratio of the lengths of the sides of  the box. This is analogous to specifying the AspectRatio of a two-dimensional plot.  For Plot3D the default is BoxRatios->Automatic.  Below, we plot the graph of the function in example 1 with a different BoxRatio.
 
Example 2:

Plot3D[ Sin[ x-Cos[y] ],{x,-3,3},{y,-3,3},
BoxRatios->{1,1,.62}];

Next, we consider the ViewPoint option. ViewPoint selects the point in space from which the observer looks at the object. Its default value is {1.3,-2.4,2.0}. This may be changed by entering a new value directly as an option or can be entered from 3D ViewPoint Selector of the Input menu. We give an example below.

Example 3:

Plot3D[ Sin[ x-Cos[y] ],{x,-3,3},{y,-3,3},
ViewPoint -> {0,3,2},
BoxRatios->{1,1,.62} ];

Our third option is  AxesLabel.  It is a command used to label the axes in  plotting.

Example 4:

Plot3D[Sin[x-Cos[y]],{x,-3,3},{y,-3,3}, 
BoxRatios->{1,1,.62},
AxesLabel -> {"x ", "y ", "z "}];

The fourth option we discuss is ColorFunction. ColorFunction is an option for various graphics functions which specifies a function to apply to z values to determine the color to use for a particular x, y region. It is an option for Plot3D, ListPlot3D, DensityPlot, ContourPlot  and related functions. The arguments provided for the function specified by ColorFunction are always in the range 0 to 1.  ColorFunction -> Automatic yields a range of gray levels. ColorFunction -> Hue yields a range of colors. Another way of applying color to a surface is to select the color you want from Color Selector of  the Input menu. 

Example 5:

Plot3D[ { Sin[x-Cos[y]], RGBColor[0.996109, 0, 0]},
{x,-3,3},{y,-3,3} ];

Example 6:

Plot3D[Sin[x-Cos[y]],{x,-3,3},{y,-3,3},
ColorFunction->Hue ];

Show is another option of Plot3D.   Show[graphics, options] displays two-and three-dimensional graphics, using the options specified. Show[(Subscript["\!\(\*StyleBox[\"\\\"g\\\"\", \"TI\"]\)", 1]), (Subscript["\!\(\*StyleBox[\"\\\"g\\\"\", \"TI\"]\)", 2]), …] shows several plots combined.  

Example 7: Plot the graphs of f(x,y) = 3x + 4y - 3 and g(x,y) = 10 sin(xy) on the same axes.

a= Plot3D [ {3x+4y-3,RGBColor[1.000,0.000,0.000]}, {x,-3,3},
{y,-3,3} ,
DisplayFunction->Identity ];

b=Plot3D[ {10 Sin[x*y],RGBColor[0.000,0.502,0.251]}, {x,-3,3},
 {y, -3,3},
 DisplayFunction->Identity ];

Show[a, b,DisplayFunction->$DisplayFunction];

Show[GraphicsArray[{a, b}]];

5.1.2   ParametricPlot3D

ParametricPlot3D is a direct analog of ParametricPlot.  Depending on the input, ParametricPlot3D  produces a space curve or a surface. ParametricPlot3D[{ f, g, h}, {t, a, b }] produces a three dimensional space curve parametrized by  a variable t which runs from  a to b. ParametricPlot3D[{ f, g, h}, {t, a, b },{u, c, d}] produces a two-dimensional surface parametrized by t and u. Options are given to ParametricPlot3D the same way as for  Plot3D. Most of the options are the same.

Example 8: Plot the curve that is parametrized by x = sin t, y = cos t, and z = t/3.

ParametricPlot3D[ {Sin[t],Cos[t],t/3, Thickness[.02]},
   {t,0,6Pi} ];

Example 9:  Plot the surface that is parametrized by  x = u cos u (4 + cos(u + v)), y = u sin u (4 + cos(u + v)), and z = u sin(u + v).

ParametricPlot3D[{u Cos[u] (4 + Cos[u + v]),  
        u Sin[u] ( 4 +  Cos[u + v]), u Sin[u + v]}, 
       {u, 0, 4  Pi}, {v,  0, 2  Pi}  ];

Exercise 5.1.  Plot each of the following.
a) z = (x^2) , -3 ≤ x ≤ 3, -3 ≤ y ≤ 3.	
b) f(x,y) = (((x^2)  -  (y^2))/((x^2) +  (y^2))),  -1 ≤ x ≤ 1, -1 ≤ y ≤ 1.
c) f(x,y) = (e^(sin(x  -  2 cos y))) , -2 ≤ x ≤ 2, -2 ≤ y ≤ 2.  
d)  z(x,y)= sin(x + sin(y))  for -4 ≤ x ≤ 4 and -4 ≤ y ≤ 4.

Exercise 5.2. Graph the portion of the helicoid (spiral ramp) that is defined by:
x = u cos v,  y = u sin v, z = v for 0 ≤ u ≤ 2  and  0 ≤ v ≤ π.

Exercise 5.3. Use parametric plot to graph the surface f(x,y) = (1/12) (Sqrt[144  -  16 (x^2)  -  9 (y^2)]).
[Hint:  z = (Sqrt[1  -  (((x/3))^2)  -  (((y/4))^2)]) and so let x = 3 r cos θ, y = 4 r sin θ. Then, z = (Sqrt[1  -  (r^2)]). ]

5.2   Partial Derivatives and Gradient

5.2.1   Partial Derivatives

The command for the partial derivative of f with respect to x  is D[f, x], and D[f,{x,n}] gives the nth partial derivative of f with respect to x. The multiple(mixed) partial derivative of f with respect to (Subscript[x, 1]), (Subscript[x, 2]), (Subscript[x, 3]),.... is obtained by D[f, (Subscript[x, 1]),(Subscript[x, 2]),(Subscript[x, 3]), ...]. In Mathematica 3.0 we can access this command from  File- Palettes- BasicInputs  or  File- Palettes- BasicCalculations- Calculus- Common Operations. The symbols are   
      (∂_□) □  and \(TraditionalForm
      \`∂\_\(□, □\)□\) .

Example 10:   Find the first partial derivatives of (x^3) + (y^2) with respect to (x^(  )) and (y^(  )).

Solution:  We give two methods.  
Method 1: We can type all the inputs and the command as follows:

Clear[x, y]D[x^3 + y^2, x]

D[x^3 + y^2, y]

Method 2:  We can use the BasicInput palette to enter the inputs.

(∂_x) ((x^3) + (y^2))

(∂_y) ((x^3) + (y^2))

Example 11:   Find the four second partial derivatives of  (x^3) sin y +  (e^xy) .   

Solution:  
Method 1:

D[x^3*Sin[y] + E^(x*y), {x, 2}]

D[x^3*Sin[y] + E^(x*y), x, y]

D[x^3*Sin[y] + E^(x*y), y, x]

D[x^3*Sin[y] + E^(x*y), {y, 2}]

Method 2:

(∂_(x, x))((x^3)*Sin[y] + (E^(x*y)))

(∂_(x, y))((x^3)*Sin[y] + (E^(x*y)))

(∂_(y, x))((x^3)*Sin[y] + (E^(x*y)))

(∂_(y, y))((x^3)*Sin[y] + (E^(x*y)))

Example 12:   Evaluate the first partial derivatives of xy + (yz^2) + xz at (-1,2,3).

Solution:    Recall that  \(TraditionalForm
      \`\(Expr\  /. {
          var\_1 -> 
            \(\(val\_\(1, \)\) var\_2 -> 
              \(\(val\_\(2, \)\) var\_3 -> val\_\(\(3, \)\ \) ... \)\)\ \ \ }
          \ \)\) is the command  for substituting (Subscript[var, 1]) by (Subscript[val, 1]), (Subscript[var, 2]) by (Subscript[val, 2]), (Subscript[var, 3]) by (Subscript[val, 3]), .... in Expr.

Clear[x,y,z]
D[x*y + y*z^2 + x*z,x]/.{x->-1, y->2, z->3}

D[x*y  +  y*z^2  +  x*z, y] /. {x -> -1,  y -> 2,  z -> 3}

D[x*y + y*z^2 + x*z, z] /. {x -> -1,  y -> 2,  z -> 3}

Example 13:    Let f(x,y,z) =((ye )^x) + x ln z  (e^(-y)). Find   (Subscript[f, xxx]), (Subscript[f, xyz]), (Subscript[f, xzz]), (Subscript[f, zxz ]), and (Subscript[f, zzx])

Solution:    First we define f(x,y,z) in Mathematica. Then we use the \(TraditionalForm
      \`∂\_\(□, □\)□\) notation. Since the palette gives only two boxes for the variables, we need to add one more box. This can be done by using CTRL + .

Clear[x, y, z, f]

f[x_, y_, z_] := 
      y*(E^x) + x *Log[z]*(E^(-y))

(∂_(x, x, x)) f[x, y, z]

(∂_(x, y, z)) f[x, y, z]

(∂_(x, z, z)) f[x, y, z]

(∂_(z, x, z)) f[x, y, z]

(∂_(z, z, x)) f[x, y, z]

Example 14:    Let x = (t^2) + s ,    
      y = t + (s^(2 ))  and z = x sin y.  Find the first partial derivatives of z with respect to s and t.

Solution:

x = (t^2) + s   y = t + (s^(2 ))  z = x*Sin[y]

D[z, s]

D[z, t]

5.2.2   Directional Derivative and Gradient

The notation for a vector  such as u =2i  + 5j  - 6k in Mathematica is {2,5,-6}. The command for the dot product of  two vectors u and v is obtained by typing u.v 

Example 15:    Find the gradient and directional derivative of  f( x , y ) = (x^2)sin2y at the point  (1, (π/2), 0)   in the direction of v=((3/5), ((-4)/5)) 

Solution:   The gradient of f, ∇f, at (a,b) can be obtained by evaluating ∇ f=(\(TraditionalForm
      \`\(∂\_x f, ∂\_y f)\) \((a, b)\)\). We will discuss other commands for obtaining the gradient in the near future. The directional derivative of f at (a,b) in the direction of a unit vector v is given by  v. ∇f(a,b). 

Method 1:

Clear[x, y]

f=x^2*Sin[2y]
v={3/5, -4/5}

∇f = { D[f,  x],  D[f, y] } /. {x -> 1, y -> Pi/2}

direcderiv =  ∇f . v

Method 2:

Clear[f]

f[x_, y_] := (x^2) *Sin[2  y]\(	v = {3\/5, \(-4\)\/5}\)

∇f
          = {(∂_x) f[x, y], (∂_y) f[x, y]} /. {x -> 1, 
          y -> (π/2)}

direcderiv = v . ∇f

Example 16:   Find the gradient and directional derivative of  f(x,y,z) = xy+ yz + x z at the point  (1, 1, 1)  in the direction of v = 2i + j  - k    

Solution:

Clear[x, y, z]

w= x*y + y*z + x*z 
v={2,1,-1}

unitvector = v/Sqrt [v . v]

∇w = {D[w, x], D[w, y], D[w, z]} /. {x -> 1, y -> 1, z -> 1}

direcderiv = unitvector .  ∇w

Example 17:    Let the temperature T at a point (x,y) on a metal plate be given by T= (x/((x^2) + (y^2))). 
a) Plot the level curves.
b) Plot the graph of the temperature. 
c) Find the rate of change of temperature at (3,4), in the direction of u=i-2j
d) Find the unit vector in the direction of which the temperature increases most rapidly at (3,4).
e) Find the maximum rate of increase in the temperature at (3,4). 
 
Solution: The command to plot level curves is ContourPlot[ f,{x,a,b},{y,c,d}] and the command to plot the graph of functions of two variables is Plot3D[ f,{x,a,b},{y,c,d}]. Rate of change in a given direction is nothing but directional derivative. The gradient vector is the direction of most rapid increase and its norm is the maximum rate if change.

Clear[x, y, T]

T[x_, y_] := (x/((x^2) + (y^2)))

a) We give two methods of drawing level curves; one uses the ContourPlot command and the other uses the Plot command.

levelcurves1 = ContourPlot[T[x, y], {x, -5, 5}, {y, -5, 5}];

Note:  1. Use the command ContourPlot[T[x,y],{x,-5,5},{y,-5,5}, ContourShading->False]; to get unshaded contours.
2.  Solving T(x,y)=c for y we get (for  c=-5,-4,-3,-2,-1,1,2,3,4,5) the following level curves. (We leave it as an exercise to plot level curves for smaller values of |c|.)

levelcurves2 = 
      Plot[{(Sqrt[-5 x - x^2]), -(Sqrt[-5 x - x^2]) , 
          (Sqrt[-4 x - x^2]), -(Sqrt[-4 x - x^2]), 
          (Sqrt[-3 x - x^2]), -(Sqrt[-3 x - x^2]),  
          (Sqrt[-2 x - x^2]), -(Sqrt[-2 x - x^2 ]),  
          (Sqrt[-x - x^2]), -(Sqrt[- x - x^2]),   
          (Sqrt[5  x - x^2]), -(Sqrt[5  x - x^2]) , (Sqrt[4  x - x^2]), 
          -(Sqrt[4  x - x^2]), (Sqrt[3  x - x^2]), -(Sqrt[3  x - x^2]),  
          (Sqrt[2  x - x^2]), -(Sqrt[2  x - x^2 ]),  (Sqrt[x - x^2]), 
          -(Sqrt[ x - x^2])}, {x, -5, 5}];

It is a good exercise to draw these level curves using PolarPlot. Note that the polar form of the equations T(x,y) = c is r = cos(θ/c) or simply r = c cosθ (since c is arbitrary).

Here is the graph of  T.

\(\(graphofT = 
      Plot3D[T[x, y], {x, \(-5\), 5}, {y, \(-5\), 5}, 

        BoxRatios -> {1, 1, 1}]; \)\)

c)  Let u= (v/( || v || )). Then u is a unit vector and the rate of change in  temrperature  at (3, 4) in the direction of
 v is given by  (Subscript[D, u])(T)(3, 4)=Grad[T] (3, 4) . u

∇T = {D[T[x, y], x], D[T[x, y], y]}v = {1, -2}u = (v/(Sqrt[v . v]))u . ∇T /. {x -> 3, y -> 4} // N

Thus,the rate of change at (3, 4) in the direction of v is  0.0393548 .  On the last line of the above  input the command  
//N converts the output to decimal form .

d) The unit vector in the direction of which the temperature increases most rapidly at (3,4) is given by

∇(T/(Sqrt[∇T . ∇T])) /. {x -> 3, y -> 4}

e) The maximum rate of increase in the temperature at (3,4) is the norm of the gradient at this point. This can be obtained by:

(Sqrt[∇T . ∇T]) /. {x -> 3, y -> 4}

Example 18:   Let f(x, y) = 2  (x^2) - 3  xy - x + y + (y^2)and let R be the rectangle in the xy plane whose vertices are at (0,0), (2,0), (2,2), and  (0,2). 

a) Find all relative extremum values of f inside R.
b) Find the maximum and minimum values of f on  R.

Clear[f, x, y, d]

f[x_, y_] := 2  (x^2) - 3  x*y - x + y + (y^2)

Solve[{(∂_x) f[x, y] == 0, (∂_y) f[x, y] == 0}, {x, 
        y}]

d[x_, y_] :=  
      (∂_(x, x))f[x, y]*(∂_(y, y))f[x, y] - 
        ((((∂_(x, y))f[x, y]))^2)

(∂_(x, x))f[x, y] /. {x -> 1, y -> 1}d[x, y] /. {x -> 1, y -> 1}

Thus (1,1) is the local minimum point of f inside R and its local minimum value is f(1,1) = 0. Next we find the extreme values of f on the boundary of the rectangle. This is done by considering f as a function of one variable on the sides of R. Let f1=f[x,0], f2=f[x,2] for x between 0 and 2, and f3=f[0,y] and f4=f[2,y] for y between 0 and 2.   We now proceed as follows:

f1 = f[x, 0]f2 = f[x, 2]f3 = f[0, y]f4 = f[2, y]

Solve[D[f1, x] == 0 ]

Solve[D[f2, x] == 0 ]

Solve[D[f3, y] == 0 ]

Solve[D[f4, y] == 0 ]

Thus, we have the following points on the boundary of R as critical points of f: ((1/4),   0), ((7/4),  2), (2, (5/2)).  Observe that the point (0, -1/2) is outside the rectangle R. The four vertices of R: (0,0), (2,0), (0,2) and (2,2) are also critical points (Why?). We now evaluate f at each of these points and at (1,1) (the relative minimum point found above) and compare the results. We do this  using the substitution command.

\(f[x, y] /. {{x -> 1\/4, y -> 0}, \ \ {x -> 7\/4, y -> 2}, 
        \ {x -> 2, y -> 5\/2}, 

        		{x -> 0, y -> 0}, {x -> 2, y -> 0}, {x -> 0, y -> 2}, {x -> 2, 
          y -> 2}, {x -> 1, y -> 1}}\)

Thus, the minimum value of f is -1/4 and the maximum value of f is 6. At what points are these attained?
 Here is the graph of f.

\(\(Plot3D[f[x, y], {x, \(-2\), 2}, {y, \(-2\), 2}, 

      BoxRatios -> {1, 1,  .62}]; \)\)

Exercise 5.4. Let f(x, y) = ((((x - y))^2)/((x^2)  +  (y^2))).		Find  a) (Subscript[f, y]) (1,0)	b)  (Subscript[f, xxy])

Exercise 5.5. The temperature at a point (x,y) on a metal plate is modeled by;
			T(x,y) = 400 Exp ( -((x^2) + y) /2 );  x ≥ 0,  y ≽  0.
a) Find ▽ T (x, y).
b) Find the directional derivative of  T(x,y) at the point  (3, 5) in the dierection of  u = (1/2) i  + ((Sqrt[3])/2) j.
c) Find the direction of greatest increase in heat from the point (3,5).

Exercise 5.6.  Let   f(x,y) = \(TraditionalForm
      \`\(4\ x\ y\)\/\(\((\ x\^2\  + \ 1)\)\ \ \((\ y\^2\  + \ 1)\)\)\)  for -2 ≤  x  ≤ 2, and  0 ≤ y ≤3.

a) Find a set of parametric equations of the normal line and an equation of the tangent plane to the surface at the point (1, 2, 8/10).
b) Graph the surface, the normal line and the tangent plane found in a).

5.3   Multiple Integrals

The command for multiple integrals is more or less the same as  the command for single integrals. If f is a function of two variables x and y, then Integrate[f,x] integrates f with respect to x while Integrate[f,y] integrates f with respect to y.  Integrate[f, x, y ] integrates f with respect to x and y. It is worthwhile to keep in mind  that Mathematica does not give a constant of integration.   Integrate[f,{x,a,b},{y,c,d}] evaluates \(TraditionalForm
      \`∫\_a\%b\((∫\_c\%d f dy)\) 
          dx\)=\(TraditionalForm
      \`∫\_a\%b
          \(∫\_c\%d f dy dx\)\). Here c and d can be functions of x. In Mathematica 3.0, the command for multiple integrals can be entered from the BasicInputs palette as follows: From the palette click on ∫d□ or \(TraditionalForm
      \`∫\_□\%□ □ 
          d□\). Use the TAB key to move to the first box inside the integral sign and then click on the integral sign of your choice from the palette.

Example 19 : Let f (x, y)=6  (xy^2). Find a) ∫f (x, y) dx  b)∫f (x, y) dy   c
                  )∫∫f(x, y)dxdy

Solution: We will give two methods .  First we define f in Mathematica .

Clear[f, x, y]

f[x_, y_] := 6  x*(y^2)

Method 1:

∫f[x, y] \[DifferentialD]x

∫f[x, y] \[DifferentialD]y

∫∫f[x, y] \[DifferentialD]x 
          \[DifferentialD]y

Method 2:

Integrate[f[x, y], x]

Integrate[f[x, y], y]

Integrate[f[x, y], x, y]

\(TextForm\`\(In\ \ Example\ 19  c)\), 
    notice\ that\ Mathematica\ did\ not\ give\ us\ the\ general\ solution\ 
        which\ is\ \ \ x\^2\ y\^3 + g \((x)\) + h \((y)\), \ 

    where\ g\ is\ a\ function\ of\ x\ alone\ and\ h\ is\ a\ function\ of\ y\ 
      \(alone . \)\)

Example 20: \(Evaluate\ each\ of\ the\ following\ 
                \(integrals : 
				

                  \((a)\)\ \ \ \ \ 
                    \(∫\_0\%1
                        \(∫\_0\%1\(e\^\(x + y\)\) 
                          dx 
                          dy
                            \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \((b)\)\ \ \ \ \ \ 
                          \(∫\_1\%4
                              \(∫\_x\%\(\ x\^2\)x\ y 
                                dy 
                                dx
                                  \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
\ 
                                \((c)\)\ \ \ \ \ 
                                \(∫\_0\%1
                                    \(∫\_0\%y
                                      \((1 + \ x\^2 + \ y\^2)\) 
                                      dx 
                                      dy
                                        \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 
                                      \((d)\)\ \ \ \ \ \ \ \ \ \ \ 
                                      \(∫\_0\%1
                                        \(∫\_0\%\(4 - x\^2\)e\^xy\ 
                                        dy 
                                        dx
                                        \)\)\)\)\)\)\)\)\)\)

Solution: We will use the letter of the question to denote the integral:

a  = 
      (∫_0^1)
          (∫_0^1) (E^(x + y)) 
            \[DifferentialD]x \[DifferentialD]y

Simplify[%]

N[%]

b = 
      (∫_1^4)
          (∫_x^( (x^2)))x*y \[DifferentialD]y 
            \[DifferentialD]x

\(\(c = Integrate[1 + x^2 + y^2, {y, 0, 1}, {x, 0, y}]
\)\)

d = 
      (∫_0^1)(∫_0^(4 - (x^2))) 
          (E^(x *y)) \[DifferentialD]y 
            \[DifferentialD]x

This example shows that there are double integrals that Mathematica can not evaluate exactly. For such cases we can get a numerical approximation by using NIntegrate or N[%]. (We will use N[%] below.)

N[%]

We leave it as an exercise to the reader to skecth the regions of integration for the integrals of Example 2.

Example 21:   Evaluate each of the following triple integrals:
a)(∫_1^4)
          (∫_0^1)
            (∫_0^x) 2  z (e^(-(x^2))) 
              dy dx dz     b)(∫_0^2)
          (∫_(-
              (Sqrt[4 - (x^2)]))^((Sqrt[4 - (x^2)])))(∫_0^((x^2)))x 
              dz dy dx

(∫_1^4)
        (∫_0^1)
          (∫_0^x) 2  z*(E^(-(x^2))) 
            \[DifferentialD]y \[DifferentialD]x \[DifferentialD]z

(∫_0^2)
        (∫_(-(Sqrt[4 - (x^2)]))^((Sqrt[4 - (x^2)])))(∫_0
            ^((x^2)))x \[DifferentialD]z \[DifferentialD]y 
            \[DifferentialD]x

Exercise 5.7. a) Evaluate the iterated integral     
      (∫_0^2)
          (∫_x^2) (e^(-(y^2))) 
            dy  dx     
b) Switch the order of integration and evaluate  the integral in a).

Exercise 5.8. Approximate the integral   \(TextForm
      \`\(∫\_0\%2\(∫\_x\%2\ \ 
          \(\@\(16\  - \ x\^3\  - \ y\^3\)\) dy\ \ 
            dx\)\ \ \ \ \ \)\)

Exercise 5.9. Find the volume of the solid that lies below the surface z = 1 - xy and above the plane region R bounded by y = x,  y = 1,  and x =0.

Exercise 5.10. Evaluate the iterated integral (∫_0^(π/4)) (∫_0^4)  (r^2) sinθ  cosθ dr  dθ .

Exercise 5.11. a)  Evaluate the sum of the integrals

(∫_0^(5 (Sqrt[ 2]) /2 )) (∫_0^x) 
       x y  dy  dx  +  \(TextForm
      \`\(∫\_\(5 \@\(\ 2\)\ /2\)\%\(5\ \)\ 
        ∫\_0\%\(\@\(25\  - \ x\^2\)\)\ \)\)x y  dy  dx 

b) Use polar coordinates to combine the sum of the integrals in a) into a single integral and evaluate it.

Exercise 5.12. Find the surface area of  z = 2x + (y^2) over the triangle with vertices (0,0),  (2,0),  and (2,2).

Exercise 5.13. Evaluate the triple integral:

(∫_0
          ^((Sqrt[2])))(∫_0
            ^((Sqrt[2 - (x^2)])))(∫_(2 (x^2)  +  
                (y^(2    )))^(4 - (y^2)))y dz 
              dy dx